User Quota API
Base URL
/api
All endpoints require authentication using Authorization: Bearer <token>
Endpoints
GET /user-quota
Get current user quota information and usage statistics.
Headers:
Authorization: Bearer <token>
Response:
{
"id": "string",
"kuota": 0
}
Error Responses
401 Unauthorized
{
"error": "Invalid or missing token"
}
403 Forbidden
{
"error": "Access denied"
}
404 Not Found
{
"error": "User quota information not found"
}
500 Internal Server Error
{
"error": "Internal server error"
}
Rate Limiting
The API has the following rate limiting configuration:
- Rate Limit: 5 requests per second
- Burst Limit: 100 requests maximum burst
- TTL: 120 seconds (time window for rate limiting)
Rate Limit Details
RATE_LIMIT_RATE=5: Maximum of 5 requests allowed per secondRATE_LIMIT_BURST=100: Maximum burst capacity for sudden traffic spikesRATE_LIMIT_TTL_SEC=120: Time window in seconds for rate limit calculation
Rate Limit Headers
When rate limits are applied, the following headers are included in responses:
X-RateLimit-Limit: 5
X-RateLimit-Remaining: 3
X-RateLimit-Reset: 1640995200
Retry-After: 30
Rate Limit Response
When rate limit is exceeded:
{
"error": "Rate limit exceeded",
"message": "Too many requests. Please try again later.",
"retry_after": 30,
"limit": 5,
"window": "120 seconds"
}
Quota Limits by Plan
Free Plan
- Data Scraping: 50
Professional Plan
- Monthly Limit: 10,000 requests
- Data Scraping: 1,000,000
Webhooks
Quota Threshold Reached
When your usage reaches certain thresholds, webhook notifications can be sent:
{
"event": "quota_threshold_reached",
"user_id": "string",
"threshold": 80,
"usage_percentage": 82.5,
"quota_remaining": 1750,
"reset_date": "2024-01-01"
}
Quota Exhausted
{
"event": "quota_exhausted",
"user_id": "string",
"usage_percentage": 100,
"quota_remaining": 0,
"reset_date": "2024-01-01"
}